<?php

class MapGuide {

	public $MapGuide;
	public $city;
	public $mapServices = array();
	public $addList = array();

	public function __construct()
	{
	}
	
	public function setupMap($mode) {
	  if ($mode == "ol" or $mode == "osm") {
      $maptext = "<div id='mapbox'><div id='map'></div>" . $this->setSourceList() . "</div>";
    } else {
      //$maptext = setupAddressBar();
      $maptext = "<div id='mapbox'>" . $this->setupAddressBar() . "<div id='map'></div>" . $this->setSourceList() . "</div>";
    }
		return $maptext;
	}

	public function setupAddressBar() {
		$addresstext = "<div id='addressGeocode'><form action='#' onsubmit='showAddress(this.address.value); return false;'><p><input type='text' size='60' name='address' value='1600 Pennsylvania Avenue NW, Washington, DC' /><input type='submit' value='Go' /></p></form></div>";
		return $addresstext;
	}
	
	public function setSourceList() {
		$sourcetext = "<div id='sourceFrmBox'>Map source: ";
		$i = 0;
	//	foreach ($this->mapService as $service) {
			$sourcetext = $sourcetext . "<a href='javascript:resetMap(\"ww\");'>OpenLayers</a> &middot; <a href='javascript:resetMap(\"gmaps\");'>Google Maps</a> &middot; <a href='javascript:resetMap(\"osm\");'>OpenStreetMap</a>&nbsp;&nbsp;<a href='javascript:showMapInfo();' id='showMapInfoLink'>[Show Map Info]</a>";
	//		$i++;
	//	}
		$sourcetext = $sourcetext . "</div>";
		return $sourcetext;
 	}

	public function setCity($city) {
		$this->city = $city;
	}

	public function getCity(){
		return $this->city;
	}
	
	public function setMapServices($mapServices) {
		$this->mapServices = $mapServices;
	}
	
	public function getMapServices(){
		return $this->mapServices;
	}
	
	public function addAddress($add){
    array_push($this->addList,$add);
    
  }
  
  public function getAddList(){
    return $this->addList;
  }
}

